<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018/7/25
 * Time: 18:04
 */
namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\FeedBack;

class Advice extends Api
{
    protected $noNeedRight='*';

    public function fk()
    {
        $content=request()->request('content');
        $contact=request()->request('contact');

        if (empty($content)){$this->error('请填写内容');}
        if (empty($contact)){$this->error('请填写联系方式');}

        $info=FeedBack::create([
            'user_id'=>$this->auth->id,
            'from'=>1,
            'content'=>$content,
            'contact'=>$contact,
            'status'=>1
        ]);
        if ($info){
            $this->success('提交成功');
        }else{
            $this->error('提交失败');
        }
    }
}